:root {
  --primary-color: #1976d2;
  --secondary-color: #42a5f5;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: rgba(255, 255, 255, 0.9);
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --success-color: #28a745;
  --error-color: #e53935;
}

.dark-mode {
  --text-color: #f0f0f0;
  --bg-color: #1e1e2e;
  --card-bg: rgba(30, 30, 46, 0.9);
  --border-color: #444;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg-color);
  margin: 0;
  padding: 30px;
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
  font-size: 16px;
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 40px;
  opacity: 0.8;
}

/* 卡片风格 */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 24px var(--shadow-color);
  margin-bottom: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px var(--shadow-color);
}

/* 标签、段落提示 */
.note {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 8px 0;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

/* 输入框样式 */
input[type="file"] {
  width: 100%;
  margin: 15px 0 20px;
  font-size: 1rem;
}

textarea {
  width: 100%;
  height: 140px;
  padding: 15px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--card-bg);
  color: var(--text-color);
}

textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

/* 按钮样式 */
button {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(25, 118, 210, 0.3);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

/* 错误提示 */
#error {
  color: var(--error-color);
  font-weight: 600;
  text-align: center;
  margin: 20px 0;
  font-size: 1.1rem;
}

/* 文件列表 */
#uploadedFilesList {
  list-style: none;
  padding: 0;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 15px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

#uploadedFilesList li {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
  transition: background 0.2s;
}

#uploadedFilesList li:hover {
  background: rgba(25, 118, 210, 0.05);
}

#uploadedFilesList input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
}

.file-name {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
}

/* 图表展示区域 */
#vis {
  min-height: 400px;
  overflow-x: auto;
  transition: opacity 0.3s;
  position: relative;
  border-radius: 12px;
  background: var(--card-bg);
}

/* 拖拽区域 */
#dropZone {
  border: 2px dashed var(--primary-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
  transition: all 0.3s;
  background: rgba(25, 118, 210, 0.05);
}

#dropZone.dragover {
  background: rgba(25, 118, 210, 0.15);
  transform: scale(1.02);
}

#dropZone p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* 加载动画 */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 5px solid #fff;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

#loaderText {
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 主题切换按钮 */
#themeToggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 10;
}

/* 响应式调整 */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }
}
